import java.util.StringTokenizer;

class P10183_39643 {


private static final int LENGTH = 500;

public static void main(String[] args) {

       fib(LENGTH-1);
       
       String line = readLn();
       StringTokenizer st = new StringTokenizer(line);
       String a = st.nextToken();
       String b = st.nextToken();
       while (!("0".equals(a) && "0".equals(b))) {

    	   process(a, b);
    	   
    	   line = readLn();
    	   st = new StringTokenizer(line);
           a = st.nextToken();
           b = st.nextToken();
       }



   }

   private static void process(String x, String y) {
	   BigInter a = new BigInter(x);
	   BigInter b = new BigInter(y);
	   int i = 0;
	   int j = 0;
	   
		for (int k = 0; k < LENGTH; k++) {
			if (fibs[k].maiorOuIgual(a)) {
				i = k;
				break;
			}
		}
		
		for (int k = i; k < LENGTH; k++) {
			if (fibs[k].maior(b)) {
				j = k;
				break;
			}
		}

//		System.out.println(">> " +i);
//		System.out.println(">> " +j);
		
		
		System.out.println(j - i);
		
	
   }

static BigInter[] fibs = new BigInter[LENGTH];

   static int y = 3;

   static BigInter fib(int i) {
       if (fibs[i] != null) {
           return fibs[i];
       }

       fibs[0] = new BigInter("1");
       fibs[1] = new BigInter("2");
       fibs[2] = new BigInter("3");
       for (int k = y; k <= i; k++) {
           fibs[k] = fibs[k-1].soma(fibs[k-2]);
           y = k;
       }

//       System.out.println(fibs[i].toString().length());
       
       return fibs[i];
   }

   static String readLn() {
       String newLine = System.getProperty("line.separator");
       StringBuffer buffer = new StringBuffer();
       int car = -1;
       try {
           car = System.in.read();
           while ((car > 0) && (car != newLine.charAt(0))) {
               buffer.append((char)car);
               car = System.in.read();
           }
           if (car == newLine.charAt(0))
           System.in.skip(newLine.length() - 1);
       } catch (java.io.IOException e) { return (null);}
       if ((car < 0) && (buffer.length() == 0)) return (null);
       return (buffer.toString()).trim();
   }

 }

class BigInter {

   private int numeroDeDigitos;
   private int[] bigNumero;

   public BigInter(String numeroGrande) {
//              System.out.println(">> " + numeroGrande);
           numeroDeDigitos = numeroGrande.length();
           bigNumero = new int[numeroDeDigitos];

           int j = numeroGrande.length() - 1;
           for (int k = 0 ; k < numeroDeDigitos; k++) {
               bigNumero[k] = Integer.parseInt(""+(numeroGrande.charAt(j--)));
           }

   }

   public BigInter(int[] bigNumero) {
       int k = bigNumero.length - 1;
       while (bigNumero[k] == 0) {
           k--;
       }
       k++;
       this.numeroDeDigitos = k;
       this.bigNumero = bigNumero;
   }

   public BigInter soma(BigInter outro) {

//        System.out.println(">>> " +  outro.bigNumero.length);
//        System.out.println(outro);
//
//        System.out.println(">>> " + this.bigNumero.length);
//        System.out.println(this);

       int numeroDeDigitosResp = outro.numeroDeDigitos > this.numeroDeDigitos ? outro.numeroDeDigitos : this.numeroDeDigitos;
       numeroDeDigitosResp++;
       int[] resp = new int[numeroDeDigitosResp];
       int k = 0;
       int menor = outro.numeroDeDigitos < this.numeroDeDigitos ? outro.numeroDeDigitos : this.numeroDeDigitos;
       int[] maior = outro.bigNumero.length > this.bigNumero.length ? outro.bigNumero : this.bigNumero;
       for (k = 0; k <  menor; k++ ) {
           resp[k] = outro.bigNumero[k] + this.bigNumero[k] + resp[k];
           if (resp[k] > 9) {
               resp[k] -= 10;
               resp[k+1] += 1;
           }
       }
       int length = outro.numeroDeDigitos > this.numeroDeDigitos ? outro.numeroDeDigitos : this.numeroDeDigitos;
       for (int j = k; j < length; j++) {
           resp[j] += maior[j];
           if (resp[j] > 9) {
               resp[j] -= 10;
               resp[j+1] += 1;
           }
       }


//        StringBuffer sb = new StringBuffer();
//        for(int i = resp.length - 1; i >= 0 ; i--)
//                sb.append(resp[i]);
//        int y = 0;
//        while (sb.charAt(y) == '0' ) {
//            sb.setCharAt(y, ' ');
//            y++;
//        }
       return new BigInter(resp);
   }

   public String toString() {
       StringBuffer sb = new StringBuffer();
       for (int i = numeroDeDigitos - 1; i >= 0; i--)
           sb.append(bigNumero[i]);
//       int k = 0;
//       while (&&   sb.charAt(k) == '0') {
//           sb.setCharAt(k, ' ');
//           k++;
//       }
       return sb.toString().trim();
   }


   public boolean maiorOuIgual(BigInter x) {
	   String xSt = x.toString();
       String thisSt = this.toString();
	   if (xSt.length() < thisSt.length()) {
           return true;
       }
       if (xSt.length() > thisSt.length()) {
           return false;
       }


       return thisSt.compareTo(xSt) >= 0;

   }

   public boolean maior(BigInter x) {
	   String xSt = x.toString();
       String thisSt = this.toString();
	   if (xSt.length() < thisSt.length()) {
           return true;
       }
       if (xSt.length() > thisSt.length()) {
           return false;
       }


       return thisSt.compareTo(xSt) > 0;

   }

}